package com.bw.demo_mvp.base.util;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * @Author : ZhouZiYao
 * @Time : On 2023/11/16 20:24
 * @Description :
 */
public class Res {
    private static Res res;

    public static Res getRes() {
        if(res == null){
            res = new Res();
        }
        return res;
    }
    private Retrofit retrofit;

    public Retrofit getRetrofit() {
        OkHttpClient okHttpClient=new OkHttpClient.Builder().build();
        retrofit=new Retrofit.Builder()
                .client(okHttpClient)
                .baseUrl("http://10.161.9.80:7012")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();
        return retrofit;
    }
}
